DATA1 SEGMENT
    VARB    DB  14, -25, 66, -17, 78, -33, 46
            DB -96, 71, 80
    LEN EQU $-VARB
    ODDNUM DB ? CMP保存奇数的个数
    EVENNUM DB ?   ;保存偶数的个数
DATA1 ENDS

STACK1 SEGMENT STACK
    DW 20H DUP(0)
STACK1 ENDS

CODE SEGMENT
ASSUME CS:CODE, DS:DATA1, SS:STACK1
BEGIN:
    MOV AX, DATA1
    MOV DS, AX
    MOV SI, OFFSET VARB ;初始化SI,AL,CX
    MOV CX, LEN
    MOV AL, 0
L3: TEST BYTE PTR [SI], 01H ;判断SI指向的内存单元末尾数字
    JZ L1
    INC AL
L1: INC SI              ;修改SI使它指向下一个数据
    DEC CX
    JCXZ L2
    JMP L3
L2: MOV ODDNUM, AL      ;退出循环，结果保存在指定内存单元中
    MOV EVENNUM, 10
    SUB EVENNUM, AL
    MOV AH, 4CH
    INT 21H
CODE ENDS
    END BEGIN
